home *** CD-ROM | disk | FTP | other *** search
- /* getviewsettings */
- #include <stdio.h>
- #include <graphics.h>
-
- main()
- {
- int graphdriver = DETECT,graphmode;
- struct viewporttype cur_view;
- char buffer[80];
-
- /* Initialize the graphics system */
- initgraph(&graphdriver,&graphmode,"c:\\turboc");
- outtextxy(10,20,"Demonstrating getviewsettings");
- /* Get current viewport and print it out */
- getviewsettings(&cur_view);
- outtextxy(10,60,"Current viewport settings");
- sprintf(buffer,"Left, top = %d, %d",
- cur_view.left,cur_view.top);
- outtextxy(10,70,buffer);
- sprintf(buffer,"Right, bottom = %d, %d",
- cur_view.right,cur_view.bottom);
- outtextxy(10,80,buffer);
- if(!cur_view.clip)
- outtextxy(10,90,"Clipping OFF");
- else
- outtextxy(10,90,"Clipping ON");
- outtextxy(10,270,"Hit any key to exit:");
- getch();
- closegraph();
- }